const express = require('express')
const addAdminRoute = require("./routes/addAdmin");
const adminListRoute = require('./routes/adminList')
const path = require('path')
require('./db/db')
const deleteAdminRoute = require('./routes/deleteAdmin')
const loginRoute = require('./routes/login')
const islogin = require('./routes/islogin')
const logout = require('./routes/logout')
const addAdv = require('./routes/addAdv')
const advList = require('./routes/advList')
const app = express()
app.use(express.urlencoded())
app.use(express.json())
//暴露静态资源文件夹
app.use("/upload", express.static(path.resolve(__dirname, "./upload")))
app.use(addAdminRoute)
app.use(adminListRoute)
app.use(deleteAdminRoute)
app.use(loginRoute)
app.use(islogin)
app.use(logout)
app.use(addAdv)
app.use(advList)
app.listen('9500',()=>{
    console.log('服务器启动成功');
})